package com.xxxx.mytest.jihe.strings

/**
 * @program: day0303
 * @description: 尽信书，则不如无书
 * @author: CoreDao
 * @create: 2021-03-03 10:04
 **/

object StringTest {
  def main(args: Array[String]): Unit = {

    /**
     * 字符串
     * String
     * StringBuilder
     * scala基础方法文档中可以看
     */
    //a97 A65
    var str = "abcd"
    var str2 = "ABCD"
    println(str == str2)
    println(str.indexOf("b"))

    /**
     * compareTOIgnoreCase
     * 忽略大小写后的比较
     */
    println(str.compareToIgnoreCase(str2))

    /**
     * append加内容
     * substring切东西
     *
     */
    val builder = new StringBuilder
    //追加内容
    builder.append("abc")
    builder.+('d')
    builder + 'd'
  }

}
